This invention relates to installer program modules for installing a patch to a computer program module on a computer. More particularly, this invention relates to a method and system for restoring a computer to its original state after an unsuccessful patch installation attempt of an application program module by an installer program module.
Installer programs are used by users to install application program modules on a computer. Installer programs can also be used to upgrade or patch an installed application program module. A patch is a minor modification to an application program module, whereas an upgrade is a major change to an application program module. One such installer program is Microsoft Windows Installer, developed by Microsoft Corporation, Redmond, Wash. For a description of Microsoft Windows Installer, see Kelly, Mike, xe2x80x9cGain Control of Application Setup and Maintenance with the New Windows Installerxe2x80x9d, Microsoft Systems Journal, pp. 15-27, September 1998.
Sometimes, errors may occur when an installer program module is installing a patch to an application program module on a computer. For example, a user may attempt to download an upgrade or a patch to an application program module while connected to the Internet via a modem. The modem connection may become disconnected at some point after the download has begun. The user may attempt to reconnect to his Internet service provider and restart the download. However, without reconnecting to the Internet and restarting the download, the user""s computer may be left in a state such that the application program module that the user was attempting to upgrade or patch is unusable. Thus, the user may wish to return his computer to its state prior to the download attempt. However, this is not an option using prior installer program modules. Typically, prior installer program modules delete files and save updated files such that it is impossible to return the computer to its previous state.
At times, a patch installation does not fail, but instead is aborted by the user. For example, a user may terminate a patch installation before it is complete, such as by selecting a Cancel button. The user may wish to return his computer to the state it was in prior to the aborted patch installation. Thus, there is a need for a method and system for returning a computer to the state it was in prior to a failed or aborted installation.
After a failed or aborted patch installation attempt, the user may want to begin the patch installation again at the point that the patch installation failed or was aborted. Using prior installer program modules, a patch installation starts from the beginning and must be completed entirely at one time. In other words, even if most of the patch installation process has been completed in a prior failed patch installation attempt, the entire patch installation must be performed in a second installation or patch installation attempt. Thus, there is a need for an installer program module that allows a user to begin a patch installation at the point of failure of a prior failed patch installation so that dialogs requesting information already entered in a prior patch installation attempt may be bypassed.
Sometimes, patch installations of application program modules are performed by administrators deploying the application program module over a network. These administrators are not able to return the machines on the network to their previous state should a patch installation fail. Thus, there is a need for an installer program module that allows a network administrator to deploy an application program module to machines on a network while allowing for the return of the machines to a previous state should a patch installation failure or abortion occur.
Thus, there is a need for a method and system for patching an application program module that returns a computer to the state it was in prior to a failed or aborted patch installation. There is a further need for a method and system for patching an application program module that allows a user to begin a patch installation at the point of failure of a prior failed patch installation. There is still a further need for a method and system for patching an application program module that allows a network administrator to patch the application program module to machines on a network while allowing for the return of the machines to a previous state should a patch installation failure or abortion occur.
The present invention satisfies the above described needs by providing a method and system for xe2x80x9crolling backxe2x80x9d a computer, i.e., restoring a computer to its original state after a failed or aborted patch installation attempt of an application program module. In one aspect, a rollback script may be used to reverse an action of an installer program module so that a user""s machine is restored to its original state, i.e., the state before the installer program module began performing operations.
In performing operations, the installer program module typically generates patch installation script records of specific actions that are to be performed to a particular machine with regard to patch installation data. During the processing of each patch installation script record, an inverse record is created, known as a patch rollback script record. When installing a file, if there is no file with the same name in the same location stored on the machine, then a patch rollback script record describing how to delete the file is stored. However, if an old file stored in the same location does exist, then the old file is backed up to another location and a patch rollback script record is saved describing how to copy the old file back to its prior location on the machine.
In another aspect, the present invention is a user interface displayed to the user when xe2x80x9crolling backxe2x80x9d a patch installation operation. The user interface may include a rollback bar with a number of level indicators. The level indicators appear in the rollback bar and are typically rectangles that are removed as the patch rollback operation is completed. When the patch rollback operation is completed, there are typically no level indicators displayed in the rollback bar.
In still another aspect, the present invention is a method for determining whether to enable xe2x80x9crollbackxe2x80x9d. The cost of patching an application program module and the cost of storing corresponding patch rollback script records and corresponding backed-up patch rollback files is determined. It is determined whether the cost of patching the application program module and the cost of storing the patch rollback script records and backed-up patch rollback files is greater than the available disk space of the computer. If so, then the application program module is patched while storing the patch rollback script records and backed-up patch rollback files. In other words, xe2x80x9crollbackxe2x80x9d is enabled.